Skip to content

Conversation

yurakukh
Copy link

Created abstract Machine class and created classes Truck, Excavator, Bulldozer that inherited Machine. Ovirrided methods from abstract class.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your solution meets the core functional requirements: the abstract Machine class is defined correctly, each subclass (Bulldozer, Excavator, Truck) overrides public void doWork() and public void stopWork(), and MainApp demonstrates polymorphism with a Machine[] and the required calls. The issues identified are minor formatting and grammar polish, not functional blockers.

Minor fixes to address next:

  • Remove redundant empty lines per the checklist:
    • Bulldozer.java: delete the blank line right after the class opening brace and the blank line between the two methods (so the second @Override follows immediately after the first method’s closing brace).
    • Excavator.java: remove the empty line after the package declaration and the one between doWork() and the next @Override.
    • Machine.java: remove the blank line after the package declaration, the blank line right after the class declaration, and the extra blank line between method declarations.
    • Truck.java: remove the blank line after the package declaration and the one between doWork() and the next @Override.
  • Optional polish: change "it's" to the possessive "its" in messages like "Bulldozer started its work!" for grammatical correctness.

Nice work implementing the hierarchy and showcasing polymorphism clearly. With the small formatting cleanups, your code will align perfectly with the checklist.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

package core.basesyntax;

public class Bulldozer extends Machine {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has a redundant empty line immediately after the class declaration. This violates the checklist item: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove the blank line so the first @Override appears directly after the opening brace of the class. See the checklist guidance for examples .

public void doWork() {
System.out.println("Bulldozer started it's work!");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a redundant blank line between the two method blocks. This also violates the checklist item: "Please don't add redundant empty lines to your code. We don't need them after class declaration or method signature." Remove this blank line so the second @Override comes immediately after the first method's closing brace. See the checklist guidance for examples .


@Override
public void doWork() {
System.out.println("Bulldozer started it's work!");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: the printed message uses the contraction it's ("Bulldozer started it's work!"). For grammatical correctness prefer the possessive its ("Bulldozer started its work!"). The checklist requires informative English messages and this is a small polish to meet that expectation more cleanly .

@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is an unnecessary blank line. It violates the checklist guidance: "Please don't add redundant empty lines to your code." Remove the empty line between the package declaration and the class declaration to match the project's formatting guidelines.

public void doWork() {
System.out.println("Excavator started it's work!");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line between the end of doWork() and the next @Override is redundant. It violates the checklist guidance: "Please don't add redundant empty lines to your code." Remove it so methods/annotations appear without unnecessary empty lines.

@@ -0,0 +1,8 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant blank line after the package declaration. This violates the checklist item: "Please don't add redundant empty lines to your code." Remove the blank line so the package statement is followed immediately by the class declaration .

package core.basesyntax;

public abstract class Machine {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant blank line immediately after the class declaration. This violates the checklist item: "Please don't add redundant empty lines to your code." Remove this blank line so the class declaration is followed directly by its members .

public abstract class Machine {

public abstract void doWork();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant blank line between method declarations. This violates the checklist item: "Please don't add redundant empty lines to your code." Remove the blank line so method signatures and their neighbors are not separated by unnecessary empty lines .

@@ -0,0 +1,13 @@
package core.basesyntax;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unnecessary blank line. It violates the checklist guidance: "Please don't add redundant empty lines to your code." Remove the empty line between the package declaration and the class declaration to match the project's formatting guidelines.

public void doWork() {
System.out.println("Truck started it's work!");
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank line between the end of doWork() and the next @Override is redundant and violates the checklist rule: "Please don't add redundant empty lines to your code." Remove it so the annotation and method follow immediately without an extra empty line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants